home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / lib / mntlib44.zoo / mntlib / getwd.c < prev    next >
C/C++ Source or Header  |  1994-03-01  |  297b  |  21 lines

  1. #include <limits.h>
  2. #include <string.h>
  3. #include <unistd.h>
  4. #include <errno.h>
  5. #include "lib.h"
  6.  
  7. /*
  8.  * char *getwd(char *buf)
  9.  *    return cwd in buf
  10.  */
  11. char *
  12. getwd(buf)
  13.   char *buf;
  14. {
  15.   char *ret = getcwd(buf, PATH_MAX);
  16.   if (ret)
  17.     return ret;
  18.   strcpy(buf, strerror(errno));
  19.   return NULL;
  20. }
  21.